#include <stdio.h>

// 功能二维数组所有元素求和
int my_sum(int (*p)[4], int hang, int lie){
	int sum = 0;
	for(int i = 0; i < hang; i++){
		for(int j = 0; j < lie; j++){
			sum += p[i][j];
		}
	}
	return sum;
}

int main(int argc, const char *argv[])
{
	int s[3][4] = {1,2,3,4,
					5,6,7,8,
					9,10,11,12};
	int ret = my_sum(s, 3, 4);
	printf("ret = %d\n", ret);

	return 0;
}
